<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>淘淘游</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="stylesheet" href="css/mui.min.css">
		<style type="text/css">
			.textBox{
				background-color: rgb(239, 239, 244);
				margin-left: 10%;
				padding-left: 10px;
			}
			.mui-table-view{
				background-color:#efeff4;
			}
			.mui-table-view:before,.mui-table-view:after {
				 height: 0px; 
			}
			.times {display:block;margin:15px 0;background-color: #fff;padding:10px 0px;}/*首先，我们要创建一个容器class*/
			.times ul {margin-left:15px;border-left: 2px solid #00B281;padding-left: 12px;background-color: #fff;}/*利用ul标签的特性，设置外边框左移25px，左边边框是2px粗的实心线，颜色一般要浅一点*/
			.times ul li {width:100%;line-height:26px;font-weight:narmal;margin-bottom: 1px;background-color: #fff;}/*一般情况，通过li标签控制圆点回到时间线上，然后控制要出现的文字大小和是否粗体*/
			.times ul li b {width:12px;height:12px;background:#fff;border:2px solid #00B281;margin: 7px 12px 6px -19px;;border-radius:6px;-webkit-border-radius:6px;-moz-border-radius:6px;overflow:hidden;display:inline-block;float:left;}/*利用处理加粗以外没有其它特别属性b标签做时间轴的圆点。*/
			.times ul li img{margin:5px; }
			.times ul li span {font-size:16px;line-height:20px;color:#555;}/*设置span标签的属性，让它来做时间显示，加一点边距，使时间显示离时间线远一点*/
			.times ul li p {font-size:16px;line-height:25px;margin-bottom: 0;}/*这里利用段落标签p做文字介绍*/
		</style>
	</head>

	<body>
		<!--下拉刷新容器-->
		<div id="pullrefresh" class="mui-content mui-scroll-wrapper">
			<div class="mui-scroll times">
				<!--数据列表-->
				<ul class="mui-table-view mui-table-view-chevron">
					
				</ul>
			</div>
		</div> 
		<script src="js/mui.min.js"></script>
		<script>
			mui.init({
				pullRefresh: {
					container: '#pullrefresh',
					down: {
						callback: pulldownRefresh
					},
					up: {
						contentrefresh: '正在加载...',
						callback: pullupRefresh
					}
				}
			});
			/**
			 * 下拉刷新
			 */
			function pulldownRefresh() {
				setTimeout(function() {
					var table = document.body.querySelector('.mui-table-view');
					var cells = document.body.querySelectorAll('.mui-table-view-cell');
					mui('#pullrefresh').pullRefresh().endPulldownToRefresh(); //refresh completed
				}, 1500);
			}
			var count = 0;
			/**
			 * 上拉加载具体业务实现
			 */
			function pullupRefresh() {
				setTimeout(function() {
					mui('#pullrefresh').pullRefresh().endPullupToRefresh((++count > 2)); //参数为true代表没有更多数据了。
					var table = document.body.querySelector('.mui-table-view');
					var cells = document.body.querySelectorAll('.mui-table-view>li');
					for (var i = cells.length, len = i + 10; i < len; i++) {
						var li = document.createElement('li');
						li.innerHTML =  '<b></b>'+
		        						'<img class="mui-media-object mui-pull-right" src="images/shuijiao.jpg">'+
		        						'<span>2016-09-01</span>'+
		        						'<p>武汉市 洪山区 华中师范大学</p>';
						table.appendChild(li);
					}
				}, 1500);
			}
			if (mui.os.plus) {
				mui.plusReady(function() {
					setTimeout(function() {
						mui('#pullrefresh').pullRefresh().pullupLoading();
					}, 1000);

				});
			} else {
				mui.ready(function() {
					mui('#pullrefresh').pullRefresh().pullupLoading();
				});
			}
		</script>
	</body>

</html>